//
//  RootViewController.m
//  OpenEyes
//
//  Created by apple on 15/8/10.
//  Copyright (c) 2015年 袁阿迅. All rights reserved.
//

#import "RootViewController.h"
#import "DailyViewController.h"
#import "UIImage+AX.h"
#import "PrefixHeader.pch"
#import "NavigationViewController.h"

#define kHeight self.view.frame.size.height - 50
#define kWidth self.view.frame.size.width

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    DailyViewController *daily = [[DailyViewController alloc] init];
    
    
    // 添加为tabbar控制器的子控制器
    NavigationViewController *nav = [[NavigationViewController alloc] initWithRootViewController:daily];
    //设置透明度
    nav.navigationBar.translucent = NO;

    [self addChildViewController:nav];
    
//    [self creatChildViewController:daily title:@"每日精选" imageName:@"iconfont-jingxuan-6" selectImageName:@"iconfont-jingxuan-7"];
//    
//    
//    KindsViewController *kindVC = [[KindsViewController alloc] init];
//    [self creatChildViewController:kindVC title:@"往期分类" imageName:@"" selectImageName:@""];
}


/**
 *  创建子控制器
 */
//- (void)creatChildViewController:(UIViewController *)childVc title:(NSString *)title imageName:(NSString *)imageName selectImageName:(NSString *)selectImageName
//{
//    childVc.view.backgroundColor = [UIColor whiteColor];
//    
//    //设置导航栏的标题
//    childVc.navigationItem.title = @"OpenEyes";
//    
//    childVc.title = title;
//    
//    //设置没有被选中的背景图片
//    childVc.tabBarItem.image = [UIImage imageWithName:imageName];
//
//    
//    //设置选中的背景图片
//    UIImage *selectImage = [UIImage imageWithName:selectImageName];
//    
//    //选中的背景图片
//    
//    if (iOS7)
//    {
//        //显示原图，不要渲染,因为在iOS7版本之后会对选择的图片渲染成蓝色
//        selectImage = [selectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    }
//    //给选中的图片
//    childVc.tabBarItem.selectedImage = selectImage;
//    
//    // 添加为tabbar控制器的子控制器
//    NavigationViewController *nav = [[NavigationViewController alloc] initWithRootViewController:childVc];
//    //设置透明度
//    nav.navigationBar.translucent = NO;
//    
//    [self addChildViewController:nav];
//    
//}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
